package v1

import (
	"gin_mall/pkg/util"
	"gin_mall/service"
	"net/http"

	"github.com/gin-gonic/gin"
)

func OrserPay(c *gin.Context) {
	orserPay := service.OrderPay{}
	claim, _ := util.ParseToken(c.GetHeader("Authorization"))
	if err := c.ShouldBind(&orserPay); err == nil {
		// // 绑定请求体中的数据到 userUpdate 结构体中
		res := orserPay.PayDown(c.Request.Context(), claim.ID)
		c.JSON(http.StatusOK, res)
	} else {
		c.JSON(http.StatusBadRequest, err)
	}

}
